﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MINERP.COM;
using ServiceInterfaces.DataContracts;
using MINERP.MODEL.StartOrder;


namespace MINERP.StartOrder.Forms
{
    public partial class FrmFastSearchTemplete : Form
    {
        List<ProductTempleteInfo > _productList = null;
        OrderInfo _orderInfo = null;

        public FrmFastSearchTemplete(OrderInfo oi, List<ProductTempleteInfo> productList)
        {
            InitializeComponent();
            this._productList =productList;
            this._orderInfo = oi;

        }

        private void FrmFastSearchTemplete_Load(object sender, EventArgs e)
        {
            gcProductTemplate.DataSource =_productList;
            gcProductTemplate.RefreshDataSource();
        }

        private void gvProductTemplate_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            
            ProductTempleteInfo productTemplete = gvProductTemplate.GetRow(e.RowHandle) as ProductTempleteInfo;
            ((FrmMain)this.Owner)._presenter.BindOrderInfoAndProductTemplete(this._orderInfo, productTemplete);
            //WriteLogForCheck.WriteLogFile("设置：CoverWidth:" + productTemplete.CoverWidth +
            //                                         ",CoverHeight" + productTemplete.CoverHeight);
            this.Close();
        }
    }
}
